from Products.Archetypes.Registry import registerWidget
from Products.Archetypes.Widget import TypesWidget


class MonetaryWidget(TypesWidget):
    _properties = TypesWidget._properties.copy()
    _properties.update({
        'macro' : 'widget_monetary',
        'size' : '20',
        'maxlength' : '20',
        'default' : '0.00',
        'helper_css':('widget_monetary.css',),
    })

registerWidget(MonetaryWidget,
    title = 'Monetary Widget.',
    description = 'Renders a widget for handling monetary values.',
    used_for = (
        'Products.Archetypes.Field.FixedPointField',
        'Products.Archetypes.Field.ComputedField',
    ),
)
